import 'package:flutter/material.dart';
import 'pages/home_page.dart';
import 'pages/memo_page.dart';
import 'pages/goal_page.dart';
import 'pages/profile_page.dart';

/// 路由名称常量
class RouteNames {
  static const String home = '/home';
  static const String memo = '/memo';
  static const String goal = '/goal';
  static const String profile = '/profile';
}

/// 路由生成函数
Route<dynamic> generateRoute(RouteSettings settings) {
  switch (settings.name) {
    case RouteNames.home:
      return MaterialPageRoute(builder: (context) => const HomePage());
    case RouteNames.memo:
      return MaterialPageRoute(builder: (context) => const MemoPage());
    case RouteNames.goal:
      return MaterialPageRoute(builder: (context) => const GoalPage());
    case RouteNames.profile:
      return MaterialPageRoute(builder: (context) => const ProfilePage());
    default:
      return MaterialPageRoute(
        builder: (context) => const Scaffold(
          body: Center(
            child: Text('页面不存在'),
          ),
        ),
      );
  }
} 